package com.softbank.hwbanner;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    List<View> viewList = new ArrayList<>();//将要分页显示的View装入数组中

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        HWBanner hwBanner = findViewById(R.id.hwBanner);
        BaseIndicator indicator = new BaseIndicator(getApplicationContext());
        indicator.setSize(3);
        hwBanner.setIndicatorView(indicator);

        List<HWBanner.ItemViewGroup> itemViewGroups = new ArrayList<>();
        HWBanner.ItemViewGroup itemViewGroup1 = new HWBanner.ItemViewGroup(this, R.layout.layout_group_1);
        itemViewGroups.add(itemViewGroup1);
        HWBanner.ItemViewGroup itemViewGroup2 = new HWBanner.ItemViewGroup(this, R.layout.layout_group_2);
        itemViewGroups.add(itemViewGroup2);
        HWBanner.ItemViewGroup itemViewGroup3 = new HWBanner.ItemViewGroup(this, R.layout.layout_group_3);
        itemViewGroups.add(itemViewGroup3);
        hwBanner.setItemViewGroups(itemViewGroups);
    }


}
